<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>JavaScript window 对象常用方法及事件</title>
</head>
<body>
<script type="text/javascript">
	//window.alert("window对象alert方法");
	
	/* function dzt(){
		alert("5秒后启动");
	}
	window.setTimeout("dzt()",5000);//注意这里5000的单位是毫秒，即5秒 */
	
	function setDateTime(){
		var date=new Date();
		var day=date.getDay();
		var week;
		switch(day){
			case 0:week="星期日";break;
			case 1:week="星期一";break;
			case 2:week="星期二";break;
			case 3:week="星期三";break;
			case 4:week="星期四";break;
			case 5:week="星期五";break;
			case 6:week="星期六";break;
		}
		//打印此时此刻的时刻表
		var today=date.getFullYear()+"年"+(date.getMonth()+1)+"月"+date.getDate()
		+"日"+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()+" ，"+week;
		document.getElementById("today").innerHTML=today;
	}
	window.setInterval("setDateTime()",1000);
	
	window.open("http:www.baidu.com");
</script>
<div id="today"></div>
</body>
</html>